//
//  AVOSErrorManger.m
//  FunnyVideo
//
//  Created by 李鑫 on 15/9/28.
//  Copyright © 2015年 NewEggTech. All rights reserved.
//

#import "AVOSErrorManger.h"

@implementation AVOSErrorManger

+ (BOOL)errorExsit:(NSUInteger)avosRespCode{
    return !([AVOSErrorManger errorForCode:avosRespCode]==AVOSErrorTypeNone);
}
+ (AVOSErrorType)errorForCode:(NSUInteger)avosRespCode{
    if(avosRespCode == AVOSErrorCodeNone)
    return AVOSErrorTypeNone;
    else if (avosRespCode == AVOSErrorTypeNoneData)
        return AVOSErrorTypeNoneData;
    else
        return AVOSErrorTypeNetBlock;
}

+ (TLAlertType  )errorForTLAlertType:(NSUInteger)avosRespCode{
    AVOSErrorType errorType = [AVOSErrorManger errorForCode:avosRespCode];
    switch (errorType) {
        case AVOSErrorTypeNone:
            return TLAlertTypeSucc;
            break;
        case AVOSErrorTypeNetBlock:
            return TLAlertTypeNetBlock;
            break;
        case AVOSErrorTypeNoneData:
            return TLAlertTypeNoneData;
            break;
        default:
            return TLAlertTypeUnknow;
            break;
    }
}
@end
